//判断是否为PC端
import { PC_EQUIPMENT_WIDTH, MOA_EQUIPMENT_WIDTH } from "@/utils/mockConfiguration/mockConfig.js";
import MobileDetect from "mobile-detect";
const equipment = new MobileDetect(window.navigator.userAgent);
export const terminalType = equipment.phone();
function setRem() {
  const baseWidth = terminalType ? MOA_EQUIPMENT_WIDTH : PC_EQUIPMENT_WIDTH; // 根据设备类型设置基准宽度
  const deviceWidth = window.innerWidth;
  const rem = deviceWidth / baseWidth;
  document.documentElement.style.fontSize = `${rem}px`;
}
// 初始化设置
setRem();
// 窗口大小改变时重新设置
window.addEventListener("resize", setRem);
